<template>
	<view v-if="showPickup">
		<view class="pickup-pop-box">
			<view class="pickup-pop-info">
				<view class="pickup-pop-title">提货确认</view>
				<view v-if="pickupInfo.pickupType === 10" class="pickup-pop-info-text">{{pickupInfo.creatorName}}为您发起提货，请确认提货信息</view>
				<view v-else-if="pickupInfo.noticeCount === 1" class="pickup-pop-info-text">{{pickupInfo.creatorName}}为您发起提货，请确认提货信息</view>
				<view v-else class="pickup-pop-info-text">您共有{{pickupInfo.noticeCount}}笔待确认提货单，请确认提货信息</view>
				<view @click="toPickup()" class="pickup-pop-button">
					<view class="pickup-pop-button-text">去确认</view>
				</view>
			</view>
			<view @click="closePickup()" class="count-icon">
				<uni-icons type="closeempty" color="#fff" size="26"></uni-icons>
			</view>
		</view>
		<view class="zhezhao"></view>
	</view>
</template>
<script>
	export default {
		name:"pickup_pop",
		props:['data'],
		data() {
			return {
				showPickup:false,
				pickupInfo:{
					creatorName: "", // 提货发起人
					customerPickupNo: "", // 顾客提货编号
					noticeCount: 0  // 通知条数
				}
			};
		},
		/* watch: {
		    // 监听数据的变化，当数据发生变化时重新渲染组件  
		    data: {  
		      handler(newValue) {  
		        // 在这里执行重新渲染的逻辑
				this.getPickupInfo()
		      },  
		      deep: true, // 深度监听数据的变化  
		    },  
		},  */
		mounted() {
			// this.getPickupInfo()
		},
		methods:{
			// 获取是否有提货信息
			getPickupInfo() {
				var that = this;
				that.$javaApiErp.doRequest("post","/rkkt/pickuplog/getCustomerPickupNotice",{},'json').then(res=>{
					if(res.data.code == 0){
						this.pickupInfo = res.data.data
						if(this.pickupInfo.noticeCount > 0){
							this.showPickup = true
						}
					}
				})
			},
			// 关闭弹窗
			closePickup(){
				this.showPickup = false
			},
			// 跳转到提货
			toPickup(){
				this.showPickup = false
				if(this.pickupInfo.noticeCount > 1){
					uni.navigateTo({
						url:'/pages/pickup/list?index=0'
					})
				}else{
					uni.navigateTo({
						url:'/pages/pickup/index?pickupNo=' + this.pickupInfo.customerPickupNo
					})
				}
			}
		}
	}
</script>

<style>
   .zhezhao{
	   width: 100vw;
	   height: 100vh;
	   background-color: rgba(0, 0, 0, 0.5);
	   z-index: 11;
   }
   .pickup-pop-box{
	   position: fixed;
	   top: 0;
	   left: 0;
	   width: 100vw;
	   height: 100vh;
	   z-index: 12;
	   display: flex;
	   flex-direction: column;
	   justify-content: center;
	   align-items: center;
   }
   .pickup-pop-info{
	   width: 580rpx;
	   height: 502rpx;
	   background: #FFFFFF;
	   border-radius: 24rpx;
	   backdrop-filter: blur(15px);
	   display: flex;
	   flex-direction: column;
	   align-items: center;
	   justify-content: space-between;
	   padding: 50rpx;
   }
   .pickup-pop-title{
	   height: 48rpx;
	   font-size: 42rpx;
	   text-align: center;
	   font-family: PingFangSC-Semibold, PingFang SC;
	   font-weight: 600;
	   color: #333333;
	   line-height: 48rpx;
	   letter-spacing: 1px;
   }
   .pickup-pop-info-text{
	   height: 112rpx;
	   font-size: 40rpx;
	   font-family: PingFangSC-Regular, PingFang SC;
	   font-weight: 400;
	   color: #333333;
	   line-height: 56rpx;
	   text-align: center;
   }
   .pickup-pop-button-text{
	   width: 492rpx;
	   height: 90rpx;
	   line-height: 90rpx;
	   text-align: center;
	   background: #5CAE77;
	   border-radius: 44rpx;
	   font-size: 38rpx;
	   font-family: PingFangSC-Medium, PingFang SC;
	   font-weight: 500;
	   color: #FFFFFF;
   }
   .count-icon{
	   width: 76upx;
	   height: 76upx;
	   box-sizing: border-box;
	   border: 4upx solid #fff;
	   display: flex;
	   align-items: center;
	   justify-content: center;
	   border-radius: 50%;
	   margin-top: 30rpx;
   }
   
</style>
